<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 27662
  Date: 2024/8/8
  Time: 15:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>updateBook</title>
</head>
<body>
<center>
    <h1>新增页面</h1>
    <form action="${pageContext.request.contextPath}/update" method="post" enctype="multipart/form-data">
        <!--添加三个隐藏域 发到后台 防止id值丢失-->
        <input type="hidden" name="id" value="${book.id}">
        <input type="hidden" name="pageNum" value="${pageNum}">
        <!--保存图书之前的图片信息-->
        <input type="hidden" name="page" value="${book.page}">
        书名:
        <input type="text" name="bname" value="${book.bname}"><br/>
        类别:
        <select name="cid">
            <c:forEach var="category" items="${categoryList}">
                <option value="${category.cid}" ${book.cid==category.cid?'selected=selected':''}>${category.cname}</option>
            </c:forEach>
        </select><br/>
        作者:
        <input type="text" name="author" value="${book.author}"><br/>
        总页数:
        <input type="text" name="num" value="${book.num}"><br/>
        图片:
        <input type="file" name="file1"><br/>
        价格:
        <input type="text" name="price" value="${book.price}"><br/>
        <input type="submit" value="提交">
    </form>
</center>
</body>
</html>
